#! /usr/bin/python
# coding: utf-8

from Tkinter import *

root = Tk()

def printEvent(event):
    print '<Key>', event.keycode

def printReturn(event):
    print '<Return>', event.keycode

bt1 = Button(root, text='instance event')
bt1.bind('<Key>', printEvent)
bt1.focus_set()
bt1.grid()

root.mainloop()
